package com.hspedu.newData.LCR;

import com.hspedu.newData.dmsxl.ds.TreeNode;

/**
 * @Author: yh
 * @description: 
 * @CreateTime: 2025-05-17 
 * @Version: 1.0
 */

public class LCR144翻转二叉树 {
    public TreeNode flipTree(TreeNode root) {
        if (root == null) return null;

        TreeNode left = root.left;
        root.left = root.right;
        root.right = left;

        flipTree(root.left);
        flipTree(root.right);
        return root;
    }
}
